home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
301-325
/
disk_319
/
cnewssrc
/
cnews.orig.lzh
/
misc
/
delgroup
< prev
next >
Wrap
Text File
|
1989-06-27
|
947b
|
50 lines
#! /bin/sh
# delgroup - delete a newsgroup, locally only
# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/usr/lib/news/bin/config}
PATH=$NEWSCTL/bin:$NEWSBIN/maint:$NEWSBIN:$NEWSPATH ; export PATH
umask $NEWSUMASK
usage="Usage: $0 groupname"
case $# in
1) ;;
*) echo "$usage" >&2 ; exit 2 ;;
esac
case "$1" in
*/*) echo "$usage" >&2 ; exit 2 ;;
esac
already="`sed 's/[ ].*//' $NEWSCTL/active | fgrep -x \"$1\"`"
if test " $already" = " "
then
echo "$0: $1 appears not to exist" >&2
exit 1
fi
lock="$NEWSCTL/LOCK"
ltemp="$NEWSCTL/L.$$"
echo $$ >$ltemp
trap "rm -f $ltemp ; exit 0" 0 1 2 15
while true
do
if newslock $ltemp $lock
then
trap "rm -f $ltemp $lock ; exit 0" 0 1 2 15
break
fi
echo 'news system locked, waiting...'
sleep 5
done
cd $NEWSCTL
awk "\$1 != \"$1\"" active >active.tmp
mv active active.old && mv active.tmp active
echo "You may wish to rm -rf $NEWSARTS/`echo "$1" | sed 's;\.;/;g'` at some poi
t."